<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>标签</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.5.0/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
</head>
<body>
<!--导航-->
<nav th:replace="_fragments :: menu(3)" class="ui inverted attached segment m-padded-tb-mini m-shadow">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">Blog</h2>
            <a th:href="@{index.html}" href="#" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a th:href="@{types.html}" href="#" class="m-item item m-mobile-hide"><i class="home icon"></i>分类</a>
            <a th:href="@{tags.html}" href="#" class="m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <a th:href="@{archives.html}" href="#" class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a th:href="@{aboutMe.html}"  href="#" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>

            <div class="right m-item item m-mobile-hide">
                <div class="ui icon inverted transparent input">
                    <input type="text" placeholder="search......">
                    <i class="search link icon"></i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
<!--中间内容-->
<div class="m-container m-padded-tb-big">
    <div class="ui container">
        <div class="ui stackable grid">
            <!--左边的博客列表-->
            <div class="column">
                <!--header-->
                <div class="ui top attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <h3 class="ui teal header">标签</h3>
                        </div>
                        <div class="right aligned column">
                            共<h2 class="ui orange header m-inline-block m-text-thin" th:text="${#arrays.length(tags)}">14</h2>个
                        </div>
                    </div>
                </div>

                <div class="ui attached segment m-padded-tb-large">
                    <a th:href="@{/tags/{id}(id=${tag.id})}" th:each="tag : ${tags}" href="#" class="ui basic left pointing large label m-margin-top-small" th:classappend="${tag.id==activeTagId} ? 'teal'">
                        <span th:text="${tag.name}">方法论</span>
                        <div th:text="${#arrays.length(tag.blogs)}" class="detail">23</div>
                    </a>
                </div>

                <div class="ui attached segment">

                    <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                        <div class="ui middle aligned mobile reversed stackable grid">
                            <div class="eleven wide column">
                                <h3 class="ui header"><a th:text="${blog.title}" th:href="@{/blog/{id}(id=${blog.id})}"
                                                         href="#" target="_blank" class="m-black">你真的理解财富自由吗</a></h3>
                                <p th:text="|${blog.description}.......|" class="m-text ">五四运动以后的新文化运动 </p>
                                <div class="ui grid">
                                    <div class="row">
                                        <div class="eleven wide column">
                                            <div class="ui mini horizontal link list">

                                                <div class="item">
                                                    <img th:src="@{${blog.user.picture}}"
                                                         src="https://picsum.photos/id/2/100/100" alt=""
                                                         class="ui avatar image">
                                                    <div class="content"><a th:text="${blog.user.nickname}" class="header">王建凯</a>
                                                    </div>
                                                </div>
                                                <div class="item">
                                                    <i class="calendar icon"></i><span
                                                        th:text="${#dates.format(blog.updateTime, 'yyyy-MM-dd')}">2023-03-02</span>
                                                </div>
                                                <div class="item">
                                                    <i class="eye icon"></i>  <span th:text="${blog.views}">123</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right aligned five wide column">
                                            <a th:text="${blog.type.name}" href="#" target="_blank" class="ui teal basic label m-padded-tiny m-text-thin"></a>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <a th:href="@{/tags/{id}(id=${tag.id})}"
                                           th:each="tag : ${blog.tags}"
                                           th:text="${tag.name}"
                                           href="#"
                                           class="ui basic left pointing label m-padded-mini m-text-thin"
                                           th:classappend="${tag.id==activeTagId} ? 'teal'"></a>
                                    </div>
                                </div>
                            </div>
                            <div class="five wide column">
                                <a th:href="@{/blog/{id}(id=${blog.id})}" href="#" class="" target="_blank">
                                    <img th:src="@{${blog.firstPicture}}" src="https://picsum.photos/id/2/800/450"
                                         alt="" class="ui rounded image">
                                </a>
                            </div>
                        </div>
                    </div>

                </div>

                <!--footer-->
                <div th:if="${page.totalPages}>1" class="ui bottom attached segment">
                    <div th:if="${page.totalPages}>1" class="ui pagination menu">
                        <a onclick="page(this)" th:href="@{/(page=${page.number}-1)}"
                           th:unless="${page.first}" class="icon item">
                            <i class="left chevron icon">上一页</i></a>
                        <a onclick="page(this)" th:href="@{/(page=${page.number}+1)}"
                           th:unless="${page.last}" class="icon item">
                            下一页<i class="right chevron icon"></i></a>
                    </div>
                </div>

            </div>

        </div>
    </div>
</div>
<!--底部-->
<footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="item">
                    <img src="../static/images/ewm.jpg" class="ui centered rounded image" alt="" style="width:170px">
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">用户故事</a>
                    <a href="#" class="item">用户故事</a>
                    <a href="#" class="item">用户故事</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">用户故事</a>
                    <a href="#" class="item">用户故事</a>
                    <a href="#" class="item">用户故事</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header">最新博客</h4>
                <div class="ui inverted link list">
                    <p>最新微博最新微博最新微博最新微博最新微博最新微博最新微博最新微博最新微博最新微博</p>
                </div>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin">jkdasjfkldajlkasjfkajd</p>
    </div>
</footer>

<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<!--/*/</th:block>/*/-->
<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });
</script>
</body>
</html>